<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout">
	<!-- <head th:include="inc/ietm::header">
		
	</head> -->
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1" />
		<title>维修保障设备</title>
		<link type="text/css" href="css/content.css" rel="stylesheet" />
		<link type="text/css" href="css/animation.css" rel="stylesheet" />
		<script type="text/javascript" src="js/vue.min.js"></script>
		<script type="text/javascript" src="js/jquery.js" ></script>
		<script type="text/javascript" src="js/animation.js"></script>
		<script type="text/javascript" src="js/public.js"></script>
		<script type="text/javascript" th:src="@{/js/layer/layer.js}"></script>
	</head>
	<body>
		<!--返回-->
		<div class="back" onclick="history.go(-1)"><img th:src="@{/images/back.png}" /></div>
		<div th:include="header :: header"></div>
		<div class="header-title">
			<span>多媒体</span>
		</div>
				<div class="spare-a" id="container">
			<div class="questions-ar">
				<div class="spare-ara">
					<div class="spare-ara-a clearfix">
						<div class="spare-ara-al">
							<div class="spare-ara-all"><input type="text" placeholder="请输入关键字" v-model="name"/></div>
							<div class="spare-ara-alr" v-on:click="search(name)"></div>
						</div>
					</div>
					<div class="documentation paper">
					  <ul>
					  	<a href="#" v-for="media in medias">
						<li v-on:click="openDialog(media.url,media.title)">
							<div class="paper-a">标题：{{media.title}}</div>
							<div class="multimedia-a">ICN编码：{{media.code}}</div>
							<div class="multimedia-a">数据模块编码：{{media.dmCode}}</div>
						</li>
						</a>
					  </ul>
					</div>
				</div>
			</div>
			<script>
			var v=new Vue({
				el:'#container',
				data:{
					name:'',
					medias:[]
				},
				methods:{
					search:function(name){
					var that=this;
					$.get(encodeURI("/ietm/multimedia?name="+name),function(data){//一级
						that.medias=data;
					});
					},openDialog:function(url,title){
						var content="";
						if(url.toLowerCase().indexOf('.pdf')>-1)
								content="<iframe width='100%' src='viewer.html' height='100%' id='reportshow' name='reportshow' scrolling='no' frameborder='0'></iframe>";
						else if(url.toLowerCase().indexOf('.swf')>-1)
						 content= '<div style="height:500px;width:1200px;text-align:center;">'
									 +'<object id="flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1200px" align="middle" height="500px" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">'
									 +'<param name="movie" value='+url+'>'
									 +'<param name="quality" value="high">'
									 +'<param name="bgcolor" value="#F0F0F0">'
									 +'<param name="menu" value="false">'
									 +'<param name="wmode" value="opaque">'
									 +'<param name="FlashVars" value="">'
									 +'<param name="allowScriptAccess" value="sameDomain">'
									 +'<embed src="'+url+'" quality="high" bgcolor="#ffffff" width="1200px" height="500px" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /> ' 
									 +'</object></div>';
						else if(url.toLowerCase().indexOf('.avi')>-1||url.toLowerCase().indexOf('.wmv')>-1||url.toLowerCase().indexOf('.mpg')>-1||url.toLowerCase().indexOf('.mpeg')>-1)
							 content= '<div style="height:500px;width:100%;text-align:center;">'
								 	  +'<object id="MediaPlayer" width="100%" height="500px"  classid="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" type="application/x-oleobject">'
								 	  +'<param name="windowlessVideo" value="1">'
								 	  +'<param name="ShowPositionControls" value="0"/>'
								      +'<param name="AutoStart" value="0"/>'
								 	  +'<param name="EnableContextMenu" value="0"/>'  
								 	  +'<param name="URL" value='+url+' />' 
								 	  +'</object></div>';  
						else if(url.toLowerCase().indexOf('.unity3d')>-1)
							 content= '<div style="height:500px;text-align:center;">'
										 +'<object id="u3ds" classid="CLSID:444785F1-DE89-4295-863A-D46C3A781394" width="100%"  height="500px" display:block >'
										 +'<param name="src" value='+url+'/>'
										 +'<param name="firstFrameCallback" value="UnityObject2.instances[0].firstFrameCallback();">'
										 +'<param name="enableDebugging" value="0">'
										 +'<param name="disableContextMenu" value="true">'
										 +'</object></div>';
						else if(url.toLowerCase().indexOf('.cgm')>-1)
							 content= '<div style="height:600px;width:1200px;text-align:center;">'
										 +'<object id="cgms" classid="CLSID:1D4A81CB-25A3-4EB7-A75E-4F8A5386D8F8" width="1200px"  height="500px" data='+url+'></object></div>';

						 var index =  top.layer.open({
							  type: 1,
							  title: title,
							  content: content,
							  resize:false,
							  area: ['800px', '550px'],
							  maxmin: true,
							  btn: ['关闭'],
							  yes: function(index, layero){
					    	  top.layer.close(index);
							  },
							  end: function () {
									// $("#frameReft").load("/ietm/multimedia?random="+Math.random());
					          }
							});
						 top.layer.full(index);
					
					}
				},
				created:function(){
					this.search('')
				}
			});
			</script>
		</div>
		<!-- <script type="text/javascript" th:src="@{/ietm/js/multimedia.js}"></script>  -->
	</body>
</html>
